package com.crm.controller;


import com.crm.pojo.common.Result;
import com.crm.pojo.dto.IndexDto;


import com.crm.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import org.springframework.web.bind.annotation.RestController;



@RestController
public class IndexController {

    @Autowired
    private IndexService indexService;

    /**
     * 商机转换龙斗榜
     * @param dto
     * @return
     */
    @GetMapping("/index/businessChangeStatistics")
    public Result getBusIndex(IndexDto dto){
        return Result.success(indexService.getSi());
    }

    /**
     * 今日简报
     * @return
     */
//    @GetMapping("/index/getTodayInfo")
    public Result getTodayInfo(){
        return Result.success(indexService.getTodayInfo());
    }

    /**
     * 查询指定日期内的总数
     * @param beginTime
     * @param endTime
     * @return
     */
    @GetMapping("/report/getVulnerabilityMap/{beginTime}/{endTime}")
    public Result getVulnerabilityMap(@PathVariable String beginTime, @PathVariable String endTime){
        return Result.success(indexService.getVulnerabilityMap(beginTime,endTime));
    }

    /**
     * 线索转换龙斗榜
     * @param dto
     * @return
     */
    @GetMapping("/index/salesStatistic")
    public Result getSales(IndexDto dto){
      return Result.success(indexService.getCLueFinish(dto));
    }

    /**
     * 啥也不是
     * @param dto
     * @return
     */
    @GetMapping("/index")
    public Result getIndex(IndexDto dto){
        return Result.success(indexService.getIndex());
    }
}
